package org.paradise.dms.web.tools;

/**
 * 
 * Description:DWR的分頁類
 * 
 * Copyright (c) 2008-2009 paraDise sTudio(DT). All Rights Reserved.
 * 
 * @version 1.0 Apr 1, 2009 5:26:33 PM 李双江（paradise.lsj@gmail.com）created
 */

public class DWRPage {

	private int currentPage;

	private int totalPage;

	private int pageSize;

	private int totalRecords;

	public void setPageProperties(int totalRecords, int pageSize) {
		this.pageSize = pageSize;
		this.totalRecords = totalRecords;
		if (totalRecords % pageSize == 0) {
			totalPage = totalRecords / pageSize;
		} else {
			totalPage = totalRecords / pageSize + 1;
		}
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalRecords() {
		return totalRecords;
	}

	public void setTotalRecords(int totalRecords) {
		this.totalRecords = totalRecords;
	}

}
